<?php
$classid = $_GET['infoclass'];
$infoid = $_GET['infoid'];
?>
<html>
<head>
	<meta charset="UTF-8">
	<title>编辑文章</title>
	<link rel="stylesheet" href="__APP__/js/bootstrap.min.css"></head>
	<link rel="stylesheet" href="__APP__/js/uploadify.css"></head>
	<script src="__APP__/js/jquery.js"></script>
	<script src="__APP__/js/jquery.uploadify.js"></script>
	<script src="__APP__/js/bootstrap.min.js"></script>
	<style type="text/css">
	table td{font-size: 12px;}
	</style>
</head>
<body>
<form id="addnews" name="addnews" method="post" action="__CONTROLLER__/editformsave/infoid/{$infoid}">
<table style="margin: 3px;" width="99%" bgcolor="#b8d0d6" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">栏目：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF">
<select id="classid" name="classid">

<!-- <volist name="data" id="vo">
<?php if($vo['classid'] == $classid) { ?>
<option value="$data['classid']" selected="select">{$vo.classname}</option>
<?php } else { ?>
<option value="$data['classid']">{$vo.classname}</option>
<?php  } ?>
</volist> -->

<!-- class表中的classid要对应info表中的infoclass 这时才会被选中 seleced="select" -->
<volist name="data" id="vo">
<if condition="($vo['classid'] == $classid)">
<option value="{$vo.classid}" selected="select">{$vo.classname}</option>
<else />
<option value="{$vo.classid}">{$vo.classname}</option>
</if>
</volist>
</select>

</td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">标题：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><input type="text" id="infotitle" name="infotitle" value="{$infotitle}"></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">缩略图：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><div id="imgs"><img width="100px" height="100px" style="margin: 10px;" src="__ROOT__/Uploads/{$infothimg}"></div>
<input type="file" name="infothimg" id="ups">
<input type="hidden" name="infothimg" id="img_post">

</td>


</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">内容：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><textarea id="infocontent" name="infocontent" style="height: 300px;width: 600px;">{$infocontent}</textarea></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF" value="infodatetime">发布时间：</td>

<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><input type="text" value="{$infodatetime}" name="infodatetime" id="infodatetime"></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">点击次数：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><input type="text" name="infocount" value="{$infocount}"></td>
</tr>
<tr>
<td height="22" width="9%" align="right" bgcolor="#FFFFFF">审核状态：</td>
<td height="22" width="91%" align="left" bgcolor="#FFFFFF"><select id="infopost" name="infopost">
<if condition = "$infopost eq 1">
<option value="1" selected="select">审核通过</option>
<option value="0">未审核</option>
<else />
<option value="1">审核通过</option>
<option value="0" selected="select">未审核</option>
</if>
</select></td>
</tr>
<tr>
<td height="22" align="right" bgcolor="#FFFFFF">&nbsp;</td>
<td height="22" align="left" bgcolor="#FFFFFF">
<input type="submit" value="提交"/> <input type="reset" value="重置"></td>
</tr>
</table>
</form>
<script src="__ROOT__/kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="__ROOT__/kindeditor/lang/zh_CN.js"></script>
<script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#infocontent');
        });
</script>
<script type="text/javascript">
	var img = '';
	$('#ups').uploadify({
		'swf'        : '__PUBLIC__/js/uploadify.swf',
		'uploader'   : '{:U("addnews/ajax_up")}', //上传的方法
		'buttonText' : '图片上传',
		'fileTypeExts': '*.gif; *.jpg; *.png; *.jpeg',
		onUploadSuccess : function(file,data,respose){
				//把所有上传的图片都放入DIV中
				// console.log(data);
				
				$("#img_post").val(data);
				img = "<img width='100px' src='__ROOT__/Uploads/"+data+"'>";
				$('#imgs').html(img);//输出到模板id为imgs

		}
	});
</script>
</body>
</html>